The disclosures herein relate in general to image processing, and in particular to a method, system and computer program product for enhancing white balance of an image.
In a digital image, unrealistic color may be caused by a color of illumination under which the digital image was captured by a camera. A human's eyes can naturally adapt to the color of illumination, so that white continues appearing white to the human. However, the camera may fail to automatically adapt in the same way as the human's eyes.
Automatic white balance (“AWB”) adjusts the digital image to help compensate for the color of illumination by removing unrealistic color from the digital image. Nevertheless, fluorescent illumination (e.g., in some indoor environments) presents a challenge to AWB, because fluorescent illumination may fail to obey a parametric model of standard reference images that are captured by the camera under a variety of standard illumination (e.g., incandescent, natural daylight and/or simulated daylight), such as scientific light bulbs for U30 (3000K), TL84 (4000K), D50 (5000K), D65 (6500K) and D75 (7500K). Those scientific light tubes have a Color Rendering Index (“CRI”) near 100, and they closely resemble International Commission on Illumination (“CIE”) standard illuminants. By comparison, in offices and homes, commonly used fluorescent lights have a relatively low-to-medium CRI that typically ranges from 60 to 85, so the standard reference set's TL84 fluorescent reference could be insufficient for rendering of images that are captured by the camera in various indoor environments.
Accordingly, to help improve AWB, fluorescent reference images may be captured by the camera under a variety of fluorescent illumination. Unfortunately, the fluorescent reference images may overlap (in a chromaticity space) with the digital image's non-neutral object colors under outdoor shade or outdoor sunny illumination. This problem is especially pronounced for green color.
To partially address this problem, the camera's exposure setting may be useful to help weight the various references in AWB's adjustment of the digital image, so that: (a) in response to a lower exposure setting (e.g., indicating outdoor illumination), the standard reference set's daylight references (e.g., D50, D65 and D75) are weighted more than the fluorescent references and incandescent references (e.g., U30 and TL84); and (b) conversely, in response to a higher exposure setting, the fluorescent references are weighted more than the daylight references. Such weighting is relatively effective if the digital image is captured by the camera under outdoor sunny illumination, and if the fluorescent illumination has lower color temperature than daylight. However, such weighting is less effective: (a) if the digital image is captured by the camera under darker outdoor illumination, especially when the camera's exposure setting is more suitable for indoor illumination; or (b) if the fluorescent illumination has a relatively high color temperature (e.g., 5000K or 6500K), so that color temperature fails to distinguish the fluorescent references from the daylight references. For example, if the digital image includes a relatively large amount of green color (e.g., from grass and foliage) captured by the camera under darker outdoor illumination, then such weighting is relatively ineffective, and AWB may improperly adjust the digital image by: (a) neutralizing such green color in the digital image; and (b) creating a reddish or bluish cast in the digital image.